﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DisplayBoardInfo.Server.Model;

namespace DisplayBoardInfo.Server.Entities
{
    public abstract class Entity
    {
        protected DatabaseContextDataContext db;

        /// <summary>
        /// Creates new and empty instance of entity.
        /// </summary>
        public Entity()
        {
            db = new DatabaseContextDataContext();
        }

        /// <summary>
        /// Refresh all data in entity from database.
        /// </summary>
        public abstract void Refresh();

        /// <summary>
        /// Saves changes in database.
        /// </summary>
        public abstract void Save();
    }
}
